/*
 * @Author: 
 * @Date: 2022-01-27 10:31:06
 * @LastEditors: lqj
 * @LastEditTime: 2022-02-11 14:10:10
 * @Description: 请填写简介
 */
import React, { Component } from 'react';

class List extends Component {
  render() {
    const { searchList, isFirst, isLoad, isError } = this.props
    return (
      <div className="row">
        {
          isFirst ? <h5>Welcome to the current page</h5> :
          isLoad ? <div>loading...</div> :
          isError ? <div style={{color: 'red'}}>{isError}</div> :
          searchList.map(it => {
            return (
              <div key={it.id} className="card">
                <a href={it.html_url} target="_blank" rel="noreferrer">
                  <img alt='attr' src={it.avatar_url} style={{ width: '100px' }} />
                </a>
                <p className="card-text">{it.login}</p>
              </div>
            )
          })
        }
      </div>
    );
  }
}

export default List;
